﻿<?php
	session_start();
	error_reporting (E_ALL ^ E_NOTICE);
	if($_SESSION["mem_pid"] != "" || $_SESSION["mem_pid"] != NULL){
		include("./config/conn_database.php");
		$strSQL = "UPDATE add_idea 
						SET idea_topic = '".$_POST['topic']."', idea_detail = '".$_POST['detail']."', mem_pid = '".$_SESSION["mem_pid"]."' 
						WHERE idea_id = 'xx'";
		$objQuery = mysql_query($strSQL);
		if($objQuery){
			echo "<script type='text/javascript'>";
			echo "alert('บันทึกข้อมูลสำเร็จ')";
			echo "</script>";
			echo "<meta http-equiv='refresh' content='0; url=admin_menu.php'>";
		}else{
			echo "<script type='text/javascript'>";
			echo "alert('บันทึกข้อมูลไม่สำเร็จ : ติดต่อผู้ดูแลระบบ')";
			echo "</script>";
			echo "<meta http-equiv='refresh' content='0; url=edit_index_idea.php'>";
		}
		mysql_close($objConnect);
	}else{	
		echo "<script type='text/javascript'>";
		echo "alert('กรุณาเข้าสู่ระบบก่อนเข้าใช้งาน')";
		echo "</script>";
		echo "<meta http-equiv='refresh' content='0; url=index.php'>";
	}
?>